<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>万达营销流程管理系统</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="js/ie6png.js" ></script>
<script type="text/javascript">
DD_belatedPNG.fix('div,ul,li,a,p,img,body,dl,dt,dd');</script>
<![endif]-->
<script type="text/javascript">
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
</script>
<!-- 导出 -->
<script>
    var tablesToExcel = (function() {
        var uri = 'data:application/vnd.ms-excel;base64,'
            , tmplWorkbookXML = '<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">'
            + '<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"><Author>Axel Richter</Author><Created>{created}</Created></DocumentProperties>'
            + '<Styles>'
            + '<Style ss:ID="Currency"><NumberFormat ss:Format="Currency"></NumberFormat></Style>'
            + '<Style ss:ID="Date"><NumberFormat ss:Format="Medium Date"></NumberFormat></Style>'
            + '</Styles>'
            + '{worksheets}</Workbook>'
            , tmplWorksheetXML = '<Worksheet ss:Name="{nameWS}"><Table>{rows}</Table></Worksheet>'
            , tmplCellXML = '<Cell{attributeStyleID}{attributeFormula}><Data ss:Type="{nameType}">{data}</Data></Cell>'
            , base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
            , format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) }
        return function(tables, wsnames, wbname, appname) {
            var ctx = "";
            var workbookXML = "";
            var worksheetsXML = "";
            var rowsXML = "";

            for (var i = 0; i < tables.length; i++) {
                if (!tables[i].nodeType) tables[i] = document.getElementById(tables[i]);

//              控制要导出的行数
                for (var j = 0; j < tables[i].rows.length; j++) {
                    rowsXML += '<Row>';

//                    控制导出的列数（在本例中，最后一列为button,导出的文件会出错，所以导出到倒数第二列
                    for (var k = 1; k < tables[i].rows[j].cells.length-1; k++) {
                        var dataType = tables[i].rows[j].cells[k].getAttribute("data-type");
                        var dataStyle = tables[i].rows[j].cells[k].getAttribute("data-style");
                        var dataValue = tables[i].rows[j].cells[k].getAttribute("data-value");
                        dataValue = (dataValue)?dataValue:tables[i].rows[j].cells[k].innerHTML;
                        var dataFormula = tables[i].rows[j].cells[k].getAttribute("data-formula");
                        dataFormula = (dataFormula)?dataFormula:(appname=='Calc' && dataType=='DateTime')?dataValue:null;
                        ctx = {  attributeStyleID: (dataStyle=='Currency' || dataStyle=='Date')?' ss:StyleID="'+dataStyle+'"':''
                            , nameType: (dataType=='Number' || dataType=='DateTime' || dataType=='Boolean' || dataType=='Error')?dataType:'String'
                            , data: (dataFormula)?'':dataValue
                            , attributeFormula: (dataFormula)?' ss:Formula="'+dataFormula+'"':''
                        };
                        rowsXML += format(tmplCellXML, ctx);
                    }
                    rowsXML += '</Row>'
                }
                ctx = {rows: rowsXML, nameWS: wsnames[i] || 'Sheet' + i};
                worksheetsXML += format(tmplWorksheetXML, ctx);
                rowsXML = "";
            }

            ctx = {created: (new Date()).getTime(), worksheets: worksheetsXML};
            workbookXML = format(tmplWorkbookXML, ctx);

//          查看后台的打印输出
            console.log(workbookXML);

            var link = document.createElement("A");
            link.href = uri + base64(workbookXML);
            link.download = wbname || 'Workbook.xls';
            link.target = '_blank';
            document.body.appendChild(link);
            link.click();
            document.body.removeChild(link);
        }
    })();
    </script>


<script>
<!--
/*第一种形式 第二种形式 更换显示样式*/
function setTab(name,cursel,n){
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("con_"+name+"_"+i);
menu.className=i==cursel?"hover":"";
con.style.display=i==cursel?"block":"none";
}
}
//-->
//全选
 function fn1(){
    	var box1 = document.getElementById("box1");
    	var status = box1.checked;
    	//alert(box1.checked);
    	var arr = document.getElementsByName("dddd");
    	if(status){
    		for(var i = 0;i<arr.length;i++){
    			arr[i].checked = true;
    		}
    	}else{
    		for(var i = 0;i<arr.length;i++){
    			arr[i].checked = false;
    		}
    	}
    } 
    
    
//全部删除
	var str = "/wanda/order/delete.do?orderId=";
	var st1 = "/wanda/order/zuofei.do?orderId=";
	//取得复选框的ID值
	function Check(){  
	  var flag = false;
	  var obj = document.getElementsByName("dddd");
	  for(i=0;i<obj.length;i++)
	  {
	     if(obj[i].checked == true)
	     {
	        var id1 = obj[i].value;
	        str = str+id1+",";
	        st1 = st1+id1+",";
	        flag = true;
	     }
	  }
	  return flag;
	}
	
	 
	 //传递ID和选择控制
	 function CheckId(){
	    var flag = false;   
	    if(Check())
	    {
	    alert(str);
	       flag = true;
	       window.location.href=str;
	    }
	    return flag;
	 }
	 //zuofei
	 function ZuoFei(){
	    var flag = false;   
	    if(Check())
	    {
	       flag = true;
	       window.location.href=st1;
	    }
	    return flag;
	 }
    
</script>
<script>"undefined"==typeof CODE_LIVE&&(!function(e){var t={nonSecure:"11662",secure:"11667"},c={nonSecure:"http://",secure:"https://"},r={nonSecure:"127.0.0.1",secure:"gapdebug.local.genuitec.com"},n="https:"===window.location.protocol?"secure":"nonSecure";script=e.createElement("script"),script.type="text/javascript",script.async=!0,script.src=c[n]+r[n]+":"+t[n]+"/codelive-assets/bundle.js",e.getElementsByTagName("head")[0].appendChild(script)}(document),CODE_LIVE=!0);</script></head>
<body style="background:#fff;" data-genuitec-lp-enabled="false" data-genuitec-file-id="wc1-32" data-genuitec-path="/wanda Maven Webapp/src/main/webapp/WEB-INF/jsp/order_list.jsp">
<br  data-genuitec-lp-enabled="false" data-genuitec-file-id="wc1-32" data-genuitec-path="/wanda Maven Webapp/src/main/webapp/WEB-INF/jsp/order_list.jsp"/>
<div style="width:1000px;" class="tbox01 boxcenter">
  <div class="tbox02">
    <dl>
      <dt></dt>
      <dd>
        <div class="tbox02menu">
          <ul>
            <li><a href="/wanda/order/add.do">新增认购</a></li>
            <li><a href="/wanda/order/zuofeiList.do">作废订单列表</a></li>
          </ul>
        </div>
      </dd>
    </dl>
  </div>
  <div class="tbox03">
    <div class="tbox04a">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="47%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr align="left" valign="top">
                <td><img src="../images/op5_1.gif" /></td>
                <td class="ybox08td2"><ul>
                    订单列表
                  </ul></td>
                <td class="ybox08td3"></td>
                <td><img src="../images/op5_4.gif" /></td>
              </tr>
            </table>
            <div class="ybox08div">
              <div class="tbox05 margb7">
                <dl>
                  <dt>
                  <form action="/wanda/order/mohu.do" method="post">
                    <table id="tab1" width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="85" height="25" align="right" style=" padding-right:5px;">订单类型：</td>
                        <td style=" padding-right:15px;"><input name="orderType" type="text"  class="black12" id="orderType" style="width:100%;" /></td>
                       <td width="85" height="25" align="right" style=" padding-right:5px;">订单编号：</td>
                        <td style=" padding-right:15px;"><input name="orderId" type="text"  class="black12" id="orderId" style="width:100%;" /></td>
                        <td width="62" rowspan="2">         
                       <input type="submit" value="查询"  style="width:100%;"/>
                       </td>
                      </tr>

                    </table>
                    
                    </form>
                  </dt>
                </dl>
              </div>
              <table>
              <tr>
             <td> <div class="button26h"><a href="javaScript:void(0)" onclick="return CheckId()">删除</a></div></td>
             <td>      
              <div class="button26h"><a href="/wanda/order/qianyue.do">认购转签约</a></div></td>  
               <td> <div class="button26h"><a href="javaScript:void(0)" onclick="return ZuoFei()">作废</a></div></td>
               <td> <div class="button26h"><a href="javaScript:void(0)" onclick="tablesToExcel(['backViewTable'], ['ProductDay1'], 'Excel表.xls', 'Excel')">导出</a></div></td>
              </tr>
              </table>
              <table id="backViewTable" class="table table-hover table-sm table2excel" width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="ybox06table" >
                <tr>
                  <td width="30" class="ybox06td01"><input type="checkbox" name="orderId" id="box1" onclick="fn1()"/></td>
                  <td width="30" class="ybox06td01">序号</td>
                  <td class="ybox06td01">订单编号</td>-
                  <td class="ybox06td01">客户名称</td>
                  <td class="ybox06td01">购买面积</td>
                   <td class="ybox06td01">房间单价</td>
                  <td class="ybox06td01">房间总价</td>
                  <td class="ybox06td01">订单类型</td>
                   <td class="ybox06td01">付款方式</td>
                  <td class="ybox06td01">业务员名称</td>
                  <td class="ybox06td01">查看</td>
                </tr>
              <c:forEach items="${orderList}" var="rlist" varStatus="status">
                <tr>
                <td class="ybox06td02wcenter"><input type="checkbox" name="dddd" id="dddd" value="${rlist.orderId}"/></td>
                <td class="ybox06td02wcenter">${status.index+1}</td>
                <td class="ybox06td02wcenter">${rlist.orderId}</td>
                <td class="ybox06td02wcenter">${rlist.customerName }</td>
                <td class="ybox06td02wcenter">${rlist.payArea}</td>
                <td class="ybox06td02wcenter">${rlist.unitPrice}</td>
                <td class="ybox06td02wcenter">${rlist.total }</td>
                <td class="ybox06td02wcenter">${rlist.orderType}</td>
                <td class="ybox06td02wcenter">${rlist.payTypeName}</td>
                <td class="ybox06td02wcenter">${rlist.name }</td>
                <td class="ybox06td02wcenter"><a href="/wanda/order/toupdate.do?orderId=${rlist.orderId}">查看/修改</a></td>
                </tr>
                </c:forEach> 
              </table>
              <div class="nums boxcenter black12"><a href="#" class="hovera">首 页</a><a href="#">上一页</a><a href="#">下一页</a><a href="#">尾 页</a>&nbsp;&nbsp;第1/3页&nbsp;共25条&nbsp;&nbsp;转到
                <input name="textfield2" type="text" id="textfield3" size="2"/>
                页<a href="#">跳 转</a></div>
            </div></td>
          
          
        </tr>
      </table>
    </div>
  </div>
</div>
</body>

</html>
